package 测试案例;

import java.util.*;
public class Test2 {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[3 * n];

        for(int i = 0; i < 3 * n; i++){
            arr[i] = sc.nextInt();
        }
        Arrays.sort(arr);

        long sum = 0;
        for(int i = arr.length - 2; n > 0; i -= 2){
             sum += arr[i];
             n--;
        }
        System.out.println(sum);
    }
}


